package com.hd.determine.modules.alarm.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hd.common.utils.GenUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 报警明细表
 * </p>
 *
 * @author chentl123
 * @since 2020-12-28
 */
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sp_alarm_detail")
public class AlarmDetail extends Model<AlarmDetail> {

    private static final long serialVersionUID = 1L;

    //插入构造
    public AlarmDetail(String alarmDuration, String platNo, String platNoColor, String vehicleType, String transType, Date gpsTime, String enterpriseName, String enterpriseNo, String regionCode, String regionName, String alarmType, Date startTime, String alarmDesc, String handleStatus, String verifyStatus, String deptId) {
        this.id = GenUtil.newId();
        this.alarmDuration = alarmDuration;
        this.platNo = platNo;
        this.platNoColor = platNoColor;
        this.vehicleType = vehicleType;
        this.transType = transType;
        this.gpsTime = gpsTime;
        this.enterpriseName = enterpriseName;
        this.enterpriseNo = enterpriseNo;
        this.regionCode = regionCode;
        this.regionName = regionName;
        this.alarmType = alarmType;
        this.startTime = startTime;
        this.alarmDesc = alarmDesc;
        this.handleStatus = handleStatus;
        this.verifyStatus = verifyStatus;
        this.deptId = deptId;


    }

    //列表查询构造
    public AlarmDetail(String platNo, String alarmType, String startDateStr, String endDateStr, String dateRange, String enterpriseNo, String enterpriseName, String regionCode, String handleStatus, String verifyStatus, String sort, String order) {
        this.platNo = platNo;
        this.alarmType = alarmType;
        this.startDateStr = startDateStr;
        this.endDateStr = endDateStr;
        this.dateRange = dateRange;
        this.enterpriseNo = enterpriseNo;
        this.enterpriseName = enterpriseName;
        this.regionCode = regionCode;
        this.handleStatus = handleStatus;
        this.verifyStatus = verifyStatus;
        this.sort = sort;
        this.order = order;
    }

    /**
     * 报警明细id
     */
    private String id;
    /**
     * 报警时长
     */
    @TableField("alarm_duration")
    private String alarmDuration;
    /**
     * 车牌号
     */
    @TableField("plat_no")
    private String platNo;
    /**
     * 车牌颜色
     */
    @TableField("plat_no_color")
    private String platNoColor;
    /**
     * 告警类型 |  0 分段限速 1 疲劳驾驶 2 夜间禁行 3 不定位 4 无数据
     */
    @TableField("alarm_type")
    private String alarmType;
    /**
     * 报警开始时间
     */
    @TableField("start_time")
    private Date startTime;
    /**
     * 报警结束时间
     */
    @TableField("end_time")
    private Date endTime;
    /**
     * 报警描述
     */
    @TableField("alarm_desc")
    private String alarmDesc;
    /**
     * 处理状态 |  0 未处理 1 已处理
     */
    @TableField("handle_status")
    private String handleStatus;
    /**
     * 审核状态 |  0 未审核 1 已审核
     */
    @TableField("verify_status")
    private String verifyStatus;
    /**
     * 处理描述
     */
    @TableField("handle_desc")
    private String handleDesc;
    /**
     * 审核描述
     */
    @TableField("verify_desc")
    private String verifyDesc;

    /**
     * 筛选开始时间
     */
    @TableField(exist = false)
    private String startDateStr;
    /**
     * 筛选结束时间
     */
    @TableField(exist = false)
    private String endDateStr;
    /**
     * 日期范围
     */
    @TableField(exist = false)
    private String dateRange;
    /**
     * 企业编号
     */
    @TableField("enterprise_no")
    private String enterpriseNo;
    /**
     * 企业名称
     */
    @TableField("enterprise_name")
    private String enterpriseName;
    /**
     * 行政编码
     */
    @TableField("region_code")
    private String regionCode;
    /**
     * 行政区域名称
     */
    @TableField("region_name")
    private String regionName;
    /**
     * GPS 上报时间
     */
    @TableField("gps_time")
    private Date gpsTime;
    /**
     * 车辆类型
     */
    @TableField("vehicle_type")
    private String vehicleType;
    /**
     * 运输类型
     */
    @TableField("trans_type")
    private String transType;
    /**
     * 组织机构id
     */
    @TableField("dept_id")
    private String deptId;



    /**
     * 文件地址
     */
    @TableField(exist = false)
    private String fileUrl;
    @TableField(exist = false)
    private String sort;
    @TableField(exist = false)
    private String order;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
